package com.ftqh.tutorial.controller;

import com.ftqh.tutorial.service.ComputeClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/4/28.
 */
@RestController
public class ConsumerController {
    @Autowired
    ComputeClient computeClient;
    @GetMapping("/add")
    public Integer add() {
        return computeClient.add(10, 20);
    }

    @GetMapping("/users/{id}")
    public String getUser(@PathVariable("id") Integer id) {
        return computeClient.getUser(id);
    }
}
